package com.kaishengit.service;

import java.util.List;

import com.kaishengit.dao.UserDao;
import com.kaishengit.entity.User;
import com.kaishengit.util.PkUtil;

public class UserService {
private UserDao userdao=new UserDao();
public User login(User user){
	return userdao.findByNameAndPassword(user);
}
public List<User> findAll(){
	return userdao.findAll();
	
	
 }

public List<User> findByProjectId(String ProjectId){
	return userdao.findByProjectId(ProjectId);
}


public void save(String username,String password,String pic) {
	User user=new User();
		user.setId(PkUtil.getId());
		user.setName(username);
		user.setPassword(password);
		user.setPic(pic);
		userdao.save(user);
	}

}
